<template>
  <div class="app">
    <h2>我是App组件(父组件)</h2>
    <h3>School组件（子组件）给我的学校名是：{{SchoolName}}</h3>
    <hr>
    <School @getName="demo"/>
    <br>
  </div>
</template>

<script>
import School from './components/School'
export default {
  name: 'App',
  components: { School },
  data() {
    return {
      SchoolName: '',
    }
  },
  methods: {
    demo(value) {
      console.log('School组件的实例对象（vc）身上的getName事件被触发了', value)
      this.SchoolName = value
    },
  },
}
</script>

<style>
.app {
  background-color: gray;
  padding: 20px;
}
</style>